<!DOCTYPE html>
<html>

<head>

    {include file="Public/header"}
    <style>
        .row {
            margin: 0;
            padding: 0
        }
        .inputremindPeple {
            max-width: 200px;
            height: 20px;
            display: inline-block;
        }

        .aprovalSystemTable thead th {
            text-align: center;
        }
    </style>

</head>

<body class="white-bg" style="color:#333;padding:3px;">
<div class="white-bg setRemindPeopleK">
<div class="page-heade">
       <h2 class="title_color text-center">系统分组管理</h2>
    </div>
    <form action="" class="form-group" id="form1">
        <table class="table table-bordered white-bg">
            <tr>
                <td style="text-align: right;"><label for="sn">分组编号：</label></td>
                <td><input type="text" class="form-control inputremindPeple" id="sn" name="sn" value="{$sn}"></td>
                <td style="text-align: right;"><label for="AgencyName">分组名称：</label></td>
                <td><input type="text" class="form-control inputremindPeple" id="AgencyName" name="title" value="{$title}"></td>
                <td style="text-align: right;"><label for="systemName">系统名称：</label></td>
                <td><input type="text" class="form-control inputremindPeple" name="systemName" id="systemName" value="{$systemName}"></td>
            </tr>
            <tr>
                <td colspan="6" style="text-align: center;">
                    <button class="btn btn-info">查询</button>
                    <button class="btn btn-info emtyif" id="reset">清空查询条件</button>
                </td>
            </tr>
        </table>
    </form>
    <table class="table table-bordered white-bg" style="margin-bottom:0">
        <tr>
            <td><button class="btn btn-info rubish" style="display: inline-block;float: right;margin-right: 10px;" id="fanhui">返回</button></td>
        </tr>
    </table>
    <table class="table table-bordered aprovalSystemTable" style="width: 100%;">
        <tbody>
        <thead>
        <tr>
            <th>No.</th>
            <th>分组编号</th>
            <th>分组名</th>
            <th>包含系统数</th>
            <th>包含产品数</th>
            <th>创建人</th>
            <th>创建时间</th>
            <th>修改人</th>
            <th>修改时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
            {volist name="data" id="row" key="k"}
            <tr>
                <td>{$k}</td>
                <td>{$row.sn}</td>
                <td>{$row.title}</td>
                <td>{$row.title}</td>
                <td>{$row.title}</td>
                <td>{$row.title}</td>
                <td>{$row.title}</td>
                <td>{$row.title}</td>
                <td>{$row.title}</td>
                <td>
                    <a href="{:url('qiyong',array('id'=>$row.id))}" class="qiyong">启用</a>
                </td>
            </tr>
            {/volist}
        </tbody>
    </table>
    <div class="col-md-12 white-bg" style="padding: 20px 0;text-align: center;">
        {$page}
    </div>
</div>

<!-- 全局js -->
{include file="Public/footer"}
<script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
<script>
    $(document).ready(function () {
        //清除查询条件
        $('#reset').on('click',function () {
            $("#form1 input").each(function(){
                $(this).val('');
            });
            $("#form1 select").each(function(){
                $(this).val('');
            });
            $('#form1').submit()
            return false
        })

        //启用
        $('.qiyong').click(function () {
            var link = $(this).attr('href')
            swal({
                title: "您确定启用吗",
                text: "",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "确定",
                closeOnConfirm: false
            }, function (isConfirm) {
                if(isConfirm){
                    $.ajax({
                        'type':'post',
                        'url':link,
                        'dataType':'json',
                        'success':function (data) {
                            if(data.success){
                                location.reload()
                            }else
                                swal(data.msg, "", "error");
                        }
                    })
                }

            });
            return false
        });
        $('#fanhui').on('click',function(){
            parent.location.reload();
        })
    })
</script>
</body>

</html>